package com.jichangxiu.server.platform.action;

import com.jichangxiu.common.annotation.Get;
import com.jichangxiu.common.annotation.Rest;
import com.jichangxiu.common.entity.bo.PageData;
import com.jichangxiu.framework.action.BaseAction;
import com.jichangxiu.server.platform.entity.dto.PlatformLoginQueryDto;
import com.jichangxiu.server.platform.entity.vo.PlatformLoginQueryVo;
import com.jichangxiu.server.platform.service.PlatformLoginService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springdoc.api.annotations.ParameterObject;
import org.springframework.security.access.prepost.PreAuthorize;

import javax.annotation.Resource;

/**
 * PlatformLoginAction:
 * 平台-登录日志管理控制器
 *
 * @author Jcx
 * @create 2023-02-25 22:10
 */
@Slf4j
@Rest("/platform/login")
@Tag(name = "平台-登录日志管理控制器")
public class PlatformLoginAction extends BaseAction {

    @Resource
    private PlatformLoginService platformLoginService;

    /**
     * 分页查询登录日志列表
     *
     * @param platformLoginQueryVo 登录日志视图对象
     * @return 分页登录日志列表
     */
    @Get("/pageList")
    @Operation(summary = "平台-分页查询登录日志列表")
    @PreAuthorize("@ss.hasPermission('platform:login:pageList')")
    public PageData<PlatformLoginQueryDto> pageList(@ParameterObject PlatformLoginQueryVo platformLoginQueryVo) {
        return platformLoginService.pageList(platformLoginQueryVo);
    }

}
